package day0605

/**
  * @program: hadoop
  * @description: ${description}
  * @author: Qiang.Ye
  * @date: 2019-06-08 06:58
  **/
object Demo2 {

  def main(args: Array[String]): Unit = {
    //Test
    def add(x:Int)(y:Int) = x+y
    println(add(1)(2))


    //Test2 集合
    val math = scala.collection.immutable.Map("Tom"->80,"Marry"->90,"Mike"->50)
    val chinese = scala.collection.mutable.Map("Tom"->80,"Marry"->90,"Mike"->50)
    println(math)
    println(chinese)
    //获取
    println(math.get("Tom"))
    println(chinese.getOrElse("Tom1",-1))
    //修改
    chinese("Tom") = 0
    //此处会报错，因为集合是不可变的
//    math("Tom") = 0

    //添加
    chinese += "Bob"->85
    println(chinese)
    //移除
    chinese -= "Tom"
    println(chinese)





  }



}
